# thumbnailpresenter.py
from pysage import Actor, ActorManager
import logging

omanager = ActorManager.get_singleton()

class ThumbnailPresenter(Actor):
    '''takes care of delegating events for thumbnail purposes'''
    def on_start_scroll(self, event):
        '''called when the user starts to translate the viewport'''
        logging.debug('thumbnail presenter: on_start_scroll')
    def on_end_scroll(self, event):
        '''called when the user ends translation'''
        logging.debug('thumbnail presenter: on_end_scroll')
    def key_pressed(self, evt):
        pass
    def key_released(self, evt):
        pass
    def left_mouse_dclick(self, evt):
        omanager.find('thumbnailcontroller').left_mouse_dclick(evt.X, evt.Y)
    def mouse_pressed(self, evt):
        omanager.find('thumbnailcontroller').mouse_pressed(evt.X, evt.Y)
        return True
    def right_mouse_pressed(self, evt):
        omanager.find('thumbnailcontroller').right_mouse_pressed(evt.X, evt.Y)
        return True
    def mouse_released(self, evt):
        omanager.find('thumbnailcontroller').mouse_released(evt.X, evt.Y)
        return True
    def mouse_motion(self, evt):
        omanager.find('thumbnailcontroller').mouse_motion(evt.X, evt.Y, evt.LeftIsDown())
    def mouse_wheel(self, evt):
        omanager.find('thumbnailcontroller').zoom(evt.Position, evt.WheelRotation)
    def enter_window(self, evt):
        omanager.find('thumbnailcontroller').enter_window()
    def leave_window(self, evt):
        omanager.find('thumbnailcontroller').leave_window()
        
        
        
        